import {createStore} from 'vuex'

export default createStore({
    state: {
        currUser: "",
        currUserAddress: "",
        businessList:[],
        cart:[],
        cartTotal:[]
//
    },
    getters: {},
    //同步方法
    mutations: {
        addUser(state, params) {
            state.currUser = params
        },
        addBusinessList(state, params){
            state.businessList = params
        },
        addCart(state, params) {
            state.cart = params
        },

    },
    //异步方法
    actions: {
        addCurrUserAddress(store, params) {
            store.state.currUserAddress = params
        }

    },
    modules: {}
})
